//
//  ConnectNetwayCell.m
//  YSSmartHome
//
//  Created by Yahaong on 16/8/24.
//  Copyright © 2016年 yahaong. All rights reserved.
//

#import "ConnectNetwayCell.h"
#import "YHMarcros.h"

@interface ConnectNetwayCell ()

@end
@implementation ConnectNetwayCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.textLabel.font = [UIFont systemFontOfSize:14];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        UIImageView *selectedView = [[UIImageView alloc]init];
        selectedView.image = [UIImage imageNamed:@"scene_condition_selected"];
        selectedView.hidden = YES;
        [self.contentView addSubview:selectedView];
        [selectedView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.contentView);
            make.width.equalTo(kIphoneSize_Height(28));
            make.height.equalTo(kIphoneSize_Height(28));
            make.trailing.equalTo(self.contentView.trailing).offset(- kIphoneSize_Widith(10));
        }];
        self.selectedView = selectedView;
        self.textLabel.textColor = RGBColor(51, 51, 51);
    }
    return self;
}

- (void)select
{
    self.selectedView.hidden = !self.selectedView.hidden;
}

- (void)setTitle:(NSString *)title
{
    _title = [title copy];
    self.selectedView.hidden = YES;
    self.textLabel.text = title;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


@end
